home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
comm
/
mail
/
YamLHArx.lha
/
YamLHArx.yam
< prev
Wrap
Text File
|
2000-03-26
|
2KB
|
66 lines
/* YamLHArx.yam - View, extract or save attached LhA files in YAM2.0 */
/* Author = J.E. Gilpin <> Original "HandleLHA" author unknown. */
/* Create a new MIME viewer with the following settings: */
/* Attachment type = application/x-lha */
/* Extension = lha */
/* Viewer = rx YAM:rexx/YamLHArx.yam %s */
/* LhA, COPY, REQUESTFILE and RX must be in your AmigaDOS search path */
PARSE ARG attachmentname
OPTIONS RESULTS
IF ~SHOW(PORTS,'YAM') THEN EXIT
ADDRESS YAM
'Info VAR ScreenName SCREEN'
Console='CON:/33//200/Console/WAIT/CLOSE/SCREEN'||ScreenName
'Request BODY "What shall I do with this archive?" GADGETS "View contents|Extract files|Save archive|Cancel"'
Choice=RESULT
IF Choice=1 THEN ADDRESS COMMAND 'LhA >'Console' v 'attachmentname
ELSE IF Choice=2 THEN DO
ADDRESS COMMAND 'RequestFile > T:destdir.string DRAWERSONLY DRAWER=RAM: TITLE="Select a destination directory" SAVEMODE PUBSCREEN='ScreenName' '
IF RC=0 THEN DO
IF OPEN('DestName','T:destdir.string','R') THEN DO
Destination=READLN('DestName');
CALL CLOSE('DestName')
DestDir=STRIP(Destination,'B','"')
IF EXISTS(DestDir) THEN DO
ADDRESS COMMAND 'LhA >'Console' x 'attachmentname' 'DestDir
END
END
END
IF EXISTS('T:destdir.string') THEN ADDRESS COMMAND 'Delete >NIL: "T:destdir.string"'
END
ELSE IF Choice=3 THEN DO
Information.=0
'ReadInfo VAR Parts STEM Information.'
PARSE VAR Parts Number .
IF Number<1 THEN EXIT
name=STRIP(attachmentname,'B','"')
DO count=1 TO Number
IF Information.tempfile.count=name THEN DO
RealName=Information.filename.count
LEAVE
END
IF count>=Number THEN EXIT
END
ADDRESS COMMAND 'RequestFile > T:dest.string FILE='RealName' DRAWER=RAM: TITLE="Select a directory and filename" SAVEMODE PUBSCREEN='ScreenName' '
IF RC=0 THEN DO
IF OPEN('DestName','T:dest.string','R') THEN DO
Destination=READLN('DestName');
CALL CLOSE('DestName')
DestPath=STRIP(Destination,'B','"')
length=LASTPOS('/',DestPath)
IF length=0 THEN length=LASTPOS(':',DestPath)
IF length~=0 THEN DO
TestPath=LEFT(DestPath,length)
IF EXISTS(TestPath) THEN ADDRESS COMMAND 'Copy 'attachmentname' 'DestPath
END
END
END
IF EXISTS('T:dest.string') THEN ADDRESS COMMAND 'Delete >NIL: "T:dest.string"'
END